package org.bootlimn.common;

import java.util.ArrayList;

import org.bootlimn.common.Process;

public class TreeNode {
	private Process pval;
	private TreeNode parent;
	private ArrayList<TreeNode> children;
	private int indentLevel;
	
	public TreeNode() {
		this.pval = null;
		this.parent = null;
		this.children = new ArrayList<TreeNode>();
		this.indentLevel = 0;	
	}
	public TreeNode(Process p) {
		this.pval = p;
		this.parent = null;
		this.children = new ArrayList<TreeNode>();
		this.indentLevel = 0;
	}
	public void addChild(TreeNode ch) {
		ch.setParent(this);
		this.children.add(ch);
		ch.setLevel(this.getlevel());
	}

	public Process getVal() {
		return this.pval;
	}
		
	public ArrayList<TreeNode> getChildList() {
		return this.children;
	}
	
	public TreeNode getParent() {
		return this.parent;
	}
	
	public void setParent (TreeNode par) {
		this.parent = par;
	}
	
	public void setLevel(int level)
	{
		this.indentLevel = level;
	}
	
	public int getlevel()
	{
		return this.indentLevel;
	}
}
